package zero.tech.games.user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import zero.tech.games.entity.user.TUserAccount;
import zero.tech.games.user.data.UpdateDiamondVo;

public interface TUserAccountMapper {

	@Select("select * from t_user_account where uid=#{uid}")
	TUserAccount getUserAccount(int uid);

	@Insert("insert into t_user_account(uid,diamond) "
			+ "values(#{uid},#{diamond})")
	void insert(TUserAccount userAccount);

	@Update("update t_user_account set diamond=diamond+#{diamond} where uid=#{uid}")
	void addDiamond(int uid, long diamond);

	void updateDiamondBatch(List<UpdateDiamondVo> list);

	@Select("${sql}")
	List<TUserAccount> execute(String sql);

}
